<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="Dashboard">
    <meta name="keyword" content="Dashboard, Bootstrap, Admin, Template, Theme, Responsive, Fluid, Retina">

    <title>DASHGUM - Bootstrap Admin Template</title>

    {% load static %}


    <!-- Bootstrap core CSS -->
    <link href="{% static 'assets/css/bootstrap.css' %}" rel="stylesheet">
    <!--external css-->
    <link href="{% static 'assets/font-awesome/css/font-awesome.css' %}" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" href="{% static 'assets/js/bootstrap-datepicker/css/datepicker.css' %}" />
    <link rel="stylesheet" type="text/css" href="{% static 'assets/js/bootstrap-daterangepicker/daterangepicker.css' %}" />
        
    <!-- Custom styles for this template -->
    <link href="{% static 'assets/css/style.css' %}" rel="stylesheet">
    <link href="{% static 'assets/css/style-responsive.css' %}" rel="stylesheet">

    <link href="{% static 'assets/css/purchase.css' %}" rel="stylesheet">
    <link href="{% static 'assets/css/the-datepicker.css' %}" rel="stylesheet">


  </head>

  <body>

  <section id="container" >
      <!-- **********************************************************************************************************************************************************
      TOP BAR CONTENT & NOTIFICATIONS
      *********************************************************************************************************************************************************** -->
      <!--header start-->
      <header class="header black-bg">
        <div class="sidebar-toggle-box">
            <div class="fa fa-bars tooltips" data-placement="right" data-original-title="Toggle Navigation"></div>
        </div>
      <!--logo start-->
      <a href="index.html" class="logo"><b>MD集团物料管理系统</b></a>
      <!--logo end-->
      <div class="nav notify-row" id="top_menu">
          <!--  notification start -->
      
  </header>
<!--header end-->

<!-- **********************************************************************************************************************************************************
MAIN SIDEBAR MENU
*********************************************************************************************************************************************************** -->
<!--sidebar start-->
<aside>
    <div id="sidebar"  class="nav-collapse ">
        <!-- sidebar menu start-->
        <ul class="sidebar-menu" id="nav-accordion">
        
              <p class="centered"><img src="{% static 'assets/img/ui-sam.jpg' %}" class="img-circle" width="60"></a></p>
              <h5 class="centered">物料管理</h5>
                  
            <li class="mt">
                <a href="{% url 'MM:login' %}">
                    <i class="fa fa-dashboard"></i>
                    <span>主页</span>
                </a>
            </li>

            <li class="sub-menu">
                <a href="javascript:;" >
                    <i class="fa fa-desktop"></i>
                    <span>供应商管理</span>
                </a>
                <ul class="sub">
                    <li><a  href="general.html">创建新供应商</a></li>
                    <li><a  href="buttons.html">查看或修改供应商信息</a></li>
                    {% comment %} <li><a  href="panels.html">Panels</a></li> {% endcomment %}
                </ul>
            </li>

            <li class="sub-menu">
                <a href="javascript:;" >
                    <i class="fa fa-cogs"></i>
                    <span>商品管理</span>
                </a>
                <ul class="sub">
                    <li><a  href="calendar.html">创建新商品</a></li>
                    <li><a  href="gallery.html">查看或修改商品信息</a></li>
                    <li><a  href="todo_list.html">查看商品库存</a></li>
                </ul>
            </li>
            {% comment %} <li class="sub-menu">
                <a href="javascript:;" >
                    <i class="fa fa-book"></i>
                    <span>采购订单管理</span>
                </a>
                <ul class="sub">
                    <li><a  href="blank.html">Blank Page</a></li>
                    <li><a  href="login.html">Login</a></li>
                    <li><a  href="lock_screen.html">Lock Screen</a></li>
                </ul>
            </li> {% endcomment %}
            <li class="sub-menu">
                <a class="active" href="javascript:;" >
                    <i class="fa fa-tasks"></i>
                    <span>收货管理</span>
                </a>
                <ul class="sub">
                    <li class="active"><a  href="form_component.html">创建商品收据</a></li>
                    <li class="active"><a  href="form_component.html">查看商品收据</a></li>
                    <li class="active"><a  href="form_component.html">创建发票收据</a></li>
                    <li class="active"><a  href="form_component.html">查看发票收据</a></li>
                    <li class="active"><a  href="form_component.html">付款</a></li>
                </ul>
            </li>
            <li class="sub-menu">
                <a href="javascript:;" >
                    <i class="fa fa-th"></i>
                    <span>采购订单管理</span>
                </a>
                <ul class="sub">
                    <li><a  href="/mm/purchaserequisition/getpq/">采购申请</a></li>
                    <li><a  href="/mm/quotation/vreview/">供应商评估管理</a></li>
                    <li><a  href="/mm/purchaseorder/searchpo/">采购订单</a></li>
                </ul>
            </li>
            

        </ul>
        <!-- sidebar menu end-->
    </div>
</aside>
      <!--sidebar end-->
      
      <!-- **********************************************************************************************************************************************************
      MAIN CONTENT
      *********************************************************************************************************************************************************** -->
      <!--main content start-->
      <section id="main-content">
          <section class="wrapper">
          	<h3><i class="fa fa-angle-right"></i> 创建报价申请</h3>
              <div class="row mt">
                <div class="col-lg-12">
                    
                <div class="form-panel3">
                    <form class="form-horizontal style-form" method="post">

                                <div class="col-sm-9" id="search">
                                    <div class="col-sm-1 col-sm-1 control-label" id="pur-tag1">
                                        采购申请编码
                                    </div>
                                    <div class="col-sm-2" id="pur-search1">
                                        <input type="text" class="form-control" name = "id" placeholder="请输入">
                                    </div>
                                    <div class="col-sm-1 col-sm-1 control-label" id="pur-tag2">
                                        创建者编码
                                    </div>
                                    <div class="col-sm-2" id="pur-search2">
                                        <input type="text" class="form-control"  name="euserid"  placeholder="请输入" onclick="openInsertModal()" id="cjzcode">
                                    </div>
                                    <div class="col-sm-1 col-sm-1 control-label" id="pur-tag3">
                                        商品编码
                                    </div>
                                    <div class="col-sm-2" id="pur-search3">
                                        <input type="text" class="form-control"name="materialid" placeholder="请输入" id="spcode">
                                        <button type="button" class="btn btn-link " data-toggle="modal" data-target="#myModalgood">忘记编号？</button>

                                    </div>


                                <!-- </div> -->
                                <button type="submit" class="btn btn-success">搜索</button>

                            </div>
                            
                            <!-- <div class="col-lg-3">
                                
                            </div> -->
                    </form>
                </div>
            </div>
            </div>

           <!--搜索商品编码modal-->
           <div class="col-sm-12">
            <div class="modal fade" id="myModalgood" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
                <div class="modal-dialog">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                      <h4 class="modal-title" id="myModalLabel">搜索商品编码</h4>
                    </div>
                    <div class="modal-body">
                      <!-- Hi there, I am a Modal Example for Dashgum Admin Panel. -->
                      <!-- 搜索条件 -->
                      <form class="form-horizontal style-form" id="material" method="post">
                        <fieldset>
                            <div class="form-group">
                                <label class="col-sm-4 col-sm-4 control-label">
                                    <div class="pull-right">商品名称:</div>
                                    </label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="mname" id="mname">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-4 col-sm-4 control-label">
                                    <div class="pull-right">商品类型:</div>
                                    </label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="industrySector" id="industrySector">
                                </div>
                            </div>

                            <div class="form-group">
                                <label class="col-sm-4 col-sm-4 control-label">
                                    <div class="pull-right">储存位置:</div>
                                    </label>
                                <div class="col-sm-5">
                                    <input type="text" class="form-control" name="mType" id="mType">
                                </div>
                                <div class="col-sm-2">
                                    <input class="btn btn-theme02" type="submit" name="submit" value="submit">
                                </div>
                            </div>
                          </fieldset>
                    </form>
                    

                    <table  class="table table-bordered table-striped table-condensed">
                        <thead>
                            <!-- tr 指定表行标签-->
                            <tr>
                                <!-- th 设置表头内容，默认加粗-->
                                <th>商品编号</th>
                                <th>商品名称</th>
                            </tr>
                        </thead>
                        <tbody id="searchDiv">


                        </tbody>
                    </table>
                    <script>
                        $('#material').on('submit', function(e) {
                            e.preventDefault();
                            $.ajax(
                            {
                                type: "POST",
                                data:{
                                    mname: $("#mname").val(),
                                    mType: $("#mType").val(),
                                    industrySector: $("#industrySector").val(),
                                    csrfmiddlewaretoken: '{{ csrf_token }}',
                                    dataType: "json"
                                },
                                success: function(data) {
                                  //  $('#material_result').text(data);
                                    var dataObj=eval("("+data+")");
                                    var out = "";
                                    var i;
                                    //"pk": 1, "fields": {"mname": "CHLK", "mType": "HALB", "mGroup": "AS", "meaunit": "ABC", "netWeight": 1, "weightUnit": "ABC", "transGrp": "T", "loadingGrp": "L", "industrySector": "I"}
                                    for(i = 0; i < dataObj.length; i++) {
                                        //out += '<p '+ dataObj[i].fields.mname + '>' + '</p><br>';<a href="basic_table.html#">Company Ltd</a>
                                        out += '<tr><td>'+ dataObj[i].pk+ '</td><td>' + dataObj[i].fields.mname +'</td><tr>';
                                    }
                                    document.getElementById("searchDiv").innerHTML=out;
                                },
                                failure: function() {
            
                                }
                            })
                        });
                        $("table").on("dblclick","tr",function(e){
                            
                            document.getElementById("spcode").value=$(this).find('td').eq(0).text();
                            $('#myModalgood').modal('hide')
                            
                        })
                        
                    </script>
                    </div>
                    <div class="modal-footer">
                    </div>
                  </div>
                </div>
              </div>
            </div>
<!--搜索商品编码modal-->

    <!--创建者编码modal--> 
    <div class="col-sm-12">
        <div class="modal fade" id="myModalcjz" tabindex="-1" role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
            <div class="modal-dialog">
              <div class="modal-content">
                <div class="modal-header">
                  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                  <h4 class="modal-title" id="myModalLabel">创建者编码</h4>
                </div>
                <div class="modal-body">
                  
                <table  class="table table-bordered table-striped table-condensed">
                    <thead>
                        <!-- tr 指定表行标签-->
                        <tr>
                            <!-- th 设置表头内容，默认加粗-->
                            <th style="width: 100px;">序号</th>
                            <th>创建者编码</th>
                        </tr>
                    </thead>
                    <tbody id="cjzDiv">

                    </tbody>
                </table>

                <script>   //不需要提交表单，点击input框加载modal直接列出创建者编码
                    $('').on('', function(e) {
                        e.preventDefault();
                        $.ajax(
                        {
                            type: 
                            url: 
                            data:{
                               
                            },
                            success: function() {
                              var i=0 //序号
                                for() {
                                    i++
                                    out += '<tr><td>'+ i + '</td><td>' + /* 创建者编码 */ +'</td><tr>';
                                }
                                document.getElementById("cjzDiv").innerHTML=out;
                            },
                            failure: function() {
        
                            }
                        })
                    });
                    $("table").on("dblclick","tr",function(e){
                        
                        document.getElementById("cjzcode").value=$(this).find('td').eq(0).text();
                        $('#myModalcjz').modal('hide')
                        
                    })
                    
                </script>
                
                </div>
                <div class="modal-footer">
                </div>
              </div>
            </div>
          </div>
        </div>
<!--创建者编码modal-->

              <div class="row mt">
                  <div class="col-md-12">
                    <div class="col-md-12">
                    <div class="content-panel">
                        <!-- <div class="form-panel2"> -->
                        
                        <table class="table table-striped table-advance table-hover">
                                <h4><i class="fa fa-angle-right"></i> 采购申请列表</h4>
                                <hr>
                            <thead>
                            <tr>
                                <th><i class="fa fa-bullhorn"></i> 采购申请编码</th>
                                <th class="hidden-phone"><i class="fa fa-question-circle"></i> 创建者编码</th>
                                <th><i class=" fa fa-edit"></i> 创建时间</th>
                                <th><i class="fa fa-bookmark"></i> 备注</th>
                                <th> 操作</th>
                         
                            </tr>
                            </thead>
                            <tbody>
                                {% for c in quoatations %}
                                <tr>
                                    <td>{{ c.id }} </td>
                                    <td>{{ c.euser_id }} </td>
                                    <td>{{ c.time }} </td>
                                    <td class="pr-td"><span class="beizhu">{{ c.text }} </span></td>
                                    <td>
                                        <!-- <button class="btn btn-success btn-xs"><i class="fa fa-check"></i></button> -->
                                        <a href="/mm/quotation/rfqcreateinfo/{{c.id}}"><button class="btn btn-primary btn-xs"><i class="fa fa-pencil"></i></button></a>
    
                                    </td>
                                </tr>
                                {% endfor %}
                            </tbody>
                        </table>
                    </div>
                    </div>
                     
                      </div>
                  </div><!-- /col-md-12 -->
              </div><!-- /row -->

		</section><! --/wrapper -->
      </section><!-- /MAIN CONTENT -->

      <!--main content end-->
      <!--footer start-->
      <footer class="site-footer">
          <div class="text-center">
              2022 - ERP
              <a href="purchase_request.html" class="go-top">
                  <i class="fa fa-angle-up"></i>
              </a>
          </div>
      </footer>
      <!--footer end-->
  </section>

   <!-- js placed at the end of the document so the pages load faster -->
   <script src="{% static 'assets/js/jquery.js' %}"></script>
   <script src="{% static 'assets/js/bootstrap.min.js' %}"></script>
   <script class="include" type="text/javascript" src="{% static 'assets/js/jquery.dcjqaccordion.2.7.js' %}"></script>
   <script src="{% static 'assets/js/jquery.scrollTo.min.js' %}"></script>
   <script src="{% static 'assets/js/jquery.nicescroll.js' %}" type="text/javascript"></script>
   <!--common script for all pages-->
   <script src="{% static 'assets/js/common-scripts.js' %}"></script>

    


  <script>
      //custom select box

      $(function(){
          $('select.styled').customSelect();
      });

  </script>

 
  
  

<script>
   function openInsertModal() {

//弹出模态框

$("#myModalcjz").modal("show")

}

</script>



  </body>
</html>
